Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / domain / src / commonTest / kotlin / org / meshtastic / core / domain / usecase / settings / ExportProfileUseCaseTest.kt

Displaying Raw • Download

core/domain/src/commonTest/kotlin/org/meshtastic/core/domain/usecase/settings/ExportProfileUseCaseTest.kt bd2863243bab6eb213401d949839a2bc74dde7e2 (bd286324) Text, 1.48 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.domain.usecase.settings

Tff7b72import T7ee787okio.Buffer
Tff7b72import T7ee787org.meshtastic.proto.DeviceProfile
Tff7b72import T7ee787kotlin.test.BeforeTest
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertContentEquals
Tff7b72import T7ee787kotlin.test.assertTrue

Tff7b72class T56d364ExportProfileUseCaseTest Tb4b4b4{

Tff7b72private Tff7b72lateinit Tff7b72var Te6edf3useCaseTb4b4b4: Te6edf3ExportProfileUseCase

Tf0883e@BeforeTest
Tff7b72fun Td2a8ffsetUpTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3useCase Tff7b72= Te6edf3ExportProfileUseCaseTb4b4b4(Tb4b4b4)
Tb4b4b4}

Tf0883e@Test
Tff7b72fun Td2a8ff`invoke writes encoded profile to output stream`Tb4b4b4(Tb4b4b4) Tb4b4b4{
T8b949e// Arrange
Tff7b72val Te6edf3profile Tff7b72= Te6edf3DeviceProfileTb4b4b4(Te6edf3long_name Tff7b72= Ta5d6ff"Ta5d6ffExport NodeTa5d6ff"Tb4b4b4)
Tff7b72val Te6edf3buffer Tff7b72= Te6edf3BufferTb4b4b4(Tb4b4b4)

T8b949e// Act
Tff7b72val Te6edf3result Tff7b72= Te6edf3useCaseTb4b4b4(Te6edf3bufferTb4b4b4, Te6edf3profileTb4b4b4)

T8b949e// Assert
Te6edf3assertTrueTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3isSuccessTb4b4b4)
Te6edf3assertContentEqualsTb4b4b4(Te6edf3profileTb4b4b4.Te6edf3encodeTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3bufferTb4b4b4.Te6edf3readByteArrayTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s